﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;
using Pharmacy.Ultilities;
using System.Data;

namespace Pharmacy.Data.Repositories
{
    public class ListMasterData<T>
        where T : EntityObject
    {
        public Repository<T> GetListData(out List<T> lstData)
        {
            using (Pharmacy.Data.IObjectContext context = ObjectContextFactory.CreatePharmacyContext(Global.UserName, Global.CurrentConnectionString))
            {
                Repository<T> lst = new Repository<T>(context);                
                lstData = lst.AsQueryable().ToList();
                return lst; 
            }
        }

        public void SaveData(string name, string description)
        {
            

        }
    }
}
